package com.ruoyi.slope.human.rainfall.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.human.rainfall.mapper.SlopeHumanRainfallMapper;
import com.ruoyi.slope.human.rainfall.domain.SlopeHumanRainfall;
import com.ruoyi.slope.human.rainfall.service.ISlopeHumanRainfallService;

/**
 * 降雨量Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-27
 */
@Service
public class SlopeHumanRainfallServiceImpl implements ISlopeHumanRainfallService 
{
    @Autowired
    private SlopeHumanRainfallMapper slopeHumanRainfallMapper;

    /**
     * 查询降雨量
     * 
     * @param id 降雨量主键
     * @return 降雨量
     */
    @Override
    public SlopeHumanRainfall selectSlopeHumanRainfallById(Long id)
    {
        return slopeHumanRainfallMapper.selectSlopeHumanRainfallById(id);
    }

    /**
     * 查询降雨量列表
     * 
     * @param slopeHumanRainfall 降雨量
     * @return 降雨量
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeHumanRainfall> selectSlopeHumanRainfallList(SlopeHumanRainfall slopeHumanRainfall)
    {
        return slopeHumanRainfallMapper.selectSlopeHumanRainfallList(slopeHumanRainfall);
    }

    /**
     * 新增降雨量
     * 
     * @param slopeHumanRainfall 降雨量
     * @return 结果
     */
    @Override
    public int insertSlopeHumanRainfall(SlopeHumanRainfall slopeHumanRainfall)
    {
        slopeHumanRainfall.setCreateTime(DateUtils.getNowDate());
        return slopeHumanRainfallMapper.insertSlopeHumanRainfall(slopeHumanRainfall);
    }

    /**
     * 修改降雨量
     * 
     * @param slopeHumanRainfall 降雨量
     * @return 结果
     */
    @Override
    public int updateSlopeHumanRainfall(SlopeHumanRainfall slopeHumanRainfall)
    {
        slopeHumanRainfall.setUpdateTime(DateUtils.getNowDate());
        return slopeHumanRainfallMapper.updateSlopeHumanRainfall(slopeHumanRainfall);
    }

    /**
     * 批量删除降雨量
     * 
     * @param ids 需要删除的降雨量主键
     * @return 结果
     */
    @Override
    public int deleteSlopeHumanRainfallByIds(Long[] ids)
    {
        return slopeHumanRainfallMapper.deleteSlopeHumanRainfallByIds(ids);
    }

    /**
     * 删除降雨量信息
     * 
     * @param id 降雨量主键
     * @return 结果
     */
    @Override
    public int deleteSlopeHumanRainfallById(Long id)
    {
        return slopeHumanRainfallMapper.deleteSlopeHumanRainfallById(id);
    }
}
